(function () {
    'use strict';
    angular.module('module.record-system')
        .controller('RecordSystemCreateController', RecordSystemCreateController);
    RecordSystemCreateController.$inject = ['$rootScope', '$scope', '$filter', '$uibModal', '$http', '$state','$uibModalInstance', 'i18nService'];

    function RecordSystemCreateController($rootScope, $scope, $filter, $uibModal, $http, $state, $uibModalInstance, i18nService) {
        var vm = $scope;
        vm.activate = activate;     //初始化
        vm.cancel = cancel;//关闭弹窗
        vm.save = save;//保存

        activate();
        return vm;

        function activate() {
        }
        function save() {
            swal({
                title: '确认保存备案系统信息?',
                type: 'info',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                confirmButtonClass: 'btn btn-success  margin-right-10',
                cancelButtonClass: 'btn btn-primary',
                buttonsStyling: false
            }).then(function () {
                swal({
                    title: '提示',
                    text: '更新成功',
                    closeOnConfirm: true,
                    type: 'success'
                }).then(function(){
                    cancel();
                });
            });
        }
        /**
         * 关闭弹窗
         */
        function cancel() {
            $uibModalInstance.dismiss('cancel');
        }
    }
})();